<script type="text/javascript">
<!--
MINOR_JOB = {$minorJobs|@json_encode};
SELECED_MINOR = {$params.minor_job|@intval};
-->
</script>
<script type="text/javascript" src="/content/js/score.js"></script>

{assign var="title" value="クラス別ランク計算ツール"}

<h2>{$title|escape}</h2>

{include file="../partials/messages.tpl"}


<form method="get" action="/score">
	
	<h3>■クラス選択</h3>
	<div class="outer_frame cb">
		<table class="search double_column">
			<tr>
				<th style="width:30%;">クラス大分類</th>
				<td colspan="3">
					<select id="major_job" name="major_job">
						<option value="">----</option>
						{foreach from=$majorJobs item=job}
						<option value="{$job.JOB_MAJOR_CD|escape}" {if $params.major_job ==$job.JOB_MAJOR_CD} selected="selected" {/if}>{$job.JOB_NAME|escape}</option>
						{/foreach}
					</select>
				</td>
			</tr>
			
			<tr class="nobd">
				<th style="width:30%;">クラス小分類</th>
				<td colspan="3">
					<select name="minor_job" id="minor_job" disabled="disabled">
						<option value="">----</option>
					</select>
				</td>
			</tr>
		</table>
	</div>
	
	<h3>■スコア入力</h3>
	<div class="outer_frame cb">
		<table class="search double_column">
			<tr>
				<th style="width:20%;">PCダメージ</th>
				<td colspan="3">
					<input type="text" name="pc_damage" maxlength="6" class="control_int w30" value="{$params.pc_damage|escape}" />
				</td>
			</tr>
			
			<tr>
				<th style="width:20%;">キル数</th>
				<td style="width:30%;">
					<input type="text" name="kill" maxlength="2"  class="control_int" value="{$params.kill|escape}" />
				</td>
				<th style="width:20%;">デッド数</th>
				<td style="width:30%;">
					<input type="text" name="dead"  maxlength="2" class="control_int" value="{$params.dead|escape}" />
				</td>
			</tr>
			
			<tr class="nobd">
				<th style="width:20%;">建築ダメージ</th>
				<td style="width:30%;">
					<input type="text" name="build_damage" maxlength="6" class="control_int" value="{$params.build_damage|escape}" />
				</td>
				<th style="width:20%;">貢献度</th>
				<td style="width:30%;">
					<input type="text" name="contribute" maxlength="3" class="control_int" value="{$params.contribute|escape}" />
				</td>
			</tr>
		</table>
	</div>
	
	<div  class="tr">
		<input type="submit" value="計算" />
	</div>
</form>

{if $isValid}
<h3>■結果</h3>
<div class="outer_frame cb">
	<table class="search double_column">
		<tr>
			<th style="width:20%;">クラス大分類</th>
			<td colspan="3">{$result.major_job|escape}</td>
		</tr>
		<tr>
			<th>クラス小分類</th>
			<td colspan="3">{$result.minor_job|escape}</td>
		</tr>
		
		<tr>
			<th>PCダメージ</th>
			<td colspan="3">{$result.pc_damage|escape}</td>
		</tr>
		
		<tr>
			<th>職業ボーナス</th>
			<td colspan="3">{$result.bonus|escape}</td>
		</tr>
		
		<tr>
			<th>キル</th>
			<td colspan="3">{$result.kill|escape}</td>
		</tr>
		
		<tr>
			<th>デッド</th>
			<td colspan="3">{$result.dead|escape}</td>
		</tr>
		
		<tr>
			<th>建築</th>
			<td colspan="3">{$result.build_damage|escape}</td>
		</tr>
		
		<tr>
			<th>貢献度</th>
			<td colspan="3">{$result.contribute|escape}</td>
		</tr>
		
		<tr>
			<th><strong>合計</strong></th>
			<td><strong>{$result.total|escape}</strong></td>
		</tr>
		
		<tr>
			<th><strong>ランク</strong></th>
			<td><strong>{$result.rank|escape}</strong></td>
		</tr>
	</table>
</div>
{/if}